/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.playground.core.service.impl;

/**
 * This class is responsible for analize the invitations and update their status
 * when it's necessary. It runs on a separated thread, and only one execution of
 * it is allowed, i.e. this class is a singleton.
 * 
 * @author Tiago Peres
 */
public final class InvitationStatusUpdater implements Runnable {
    private static final InvitationStatusUpdater INSTANCE = new InvitationStatusUpdater();
    private boolean running;
    
    private InvitationStatusUpdater(){
        running = false;
    }
    
    public void start(){
        new Thread(INSTANCE).start();
    }

    @Override
    public void run() {
        running = true;
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }
    
    public static synchronized InvitationStatusUpdater getInstance(){
        return INSTANCE;
    }

    public boolean isRunning() {
        return running;
    }
    
}
